Package com.cisco.pt.impl
Class PtmpBuffer
java.lang.Object
com.cisco.pt.impl.PtmpBuffer
- All Implemented Interfaces:
EncodedBuffer
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanprotected byteprotected charprotected doubleprotected floatprotected intprotected IPAddressprotected IPV6Addressprotected longprotected MACAddressprotected shortprotected StringasString(boolean b) protected StringasString(byte b) protected StringasString(byte[] bytes) protected StringasString(char c) protected StringasString(double d) protected StringasString(float f) protected StringasString(int i) protected StringasString(long l) protected StringasString(short s) protected Stringprotected StringasString(IPV6Address ip) protected StringasString(MACAddress mac) protected Stringprotected UUIDvoidclear()Clear buffer of databyte[]copyRawBytes(boolean shouldFlip) Retrieve the buffer contents as an array of bytesvoidvoidflip()Flip buffer to prepare for read or write operationbooleangetBool()Retrieve the next buffer entry as a booleanbytegetByte()Retrieve the next buffer entry as a bytebyteRetrieve the next buffer entry as a raw byte, even in a text bufferchargetChar()Retrieve the next buffer entry as a chardoubleRetrieve the next buffer entry as a doublefloatgetFloat()Retrieve the next buffer entry as a floatintgetInt()Retrieve the next buffer entry as an integerRetrieve the next buffer entry as a IPAddressRetrieve the next buffer entry as a IPV6AddresslonggetLong()Retrieve the next buffer entry as a longRetrieve the next buffer entry as a MACAddressbyte[]Retrieve the remaining buffer contents as an array of bytesshortgetShort()Retrieve the next buffer entry as a shortRetrieve the next buffer entry as a StringgetUUID()Retrieve the next buffer entry as a UUIDbooleanprotected Stringprotected StringLooks at the next buffer without advancingputBool(boolean b) Store a boolean value to the encoded bufferputByte(byte b) Store a byte value to the encoded bufferputByteList(List<Byte> byteList) Store a byte list value to the encoded bufferputChar(char c) Store a char value to the encoded bufferputDouble(double d) Store a double value to the encoded bufferputFloat(float f) Store a float value to the encoded bufferputInt(int i) Store an int value to the encoded bufferStore an IPAddress value to the encoded bufferStore an IPV6Address value to the encoded bufferputLong(long l) Store a long value to the encoded bufferStore a MACAddress value to the encoded bufferputShort(short s) Store a short value to the encoded bufferStore a String value to the encoded bufferputStringAsBytes(byte[] bytes) Store a String value to the encoded buffer as a byte arrayStore a UUID value to the encoded bufferintGet size of remaining buffer datavoidrewind()Rewind buffer to startvoidsetRawBytes(byte[] bytes) Set the contents of an EncodedBuffer with an array of bytes
-
Field Details
-
buffer
-
isTextMode
protected boolean isTextMode
-
-
Constructor Details
-
PtmpBuffer
public PtmpBuffer(boolean isTextMode) -
PtmpBuffer
public PtmpBuffer(int size, boolean isTextMode)
-
-
Method Details
-
isTextMode
public boolean isTextMode() -
dump
-
copyRawBytes
public byte[] copyRawBytes(boolean shouldFlip) Description copied from interface:EncodedBufferRetrieve the buffer contents as an array of bytes- Specified by:
copyRawBytesin interfaceEncodedBuffer- Parameters:
shouldFlip- boolean flag to indicate whether to flip the buffer first- Returns:
- byte[] contents of buffer
-
getRawBytes
public byte[] getRawBytes()Description copied from interface:EncodedBufferRetrieve the remaining buffer contents as an array of bytes- Specified by:
getRawBytesin interfaceEncodedBuffer- Returns:
- byte[] contents of buffer from position to limit
-
setRawBytes
public void setRawBytes(byte[] bytes) Description copied from interface:EncodedBufferSet the contents of an EncodedBuffer with an array of bytes- Specified by:
setRawBytesin interfaceEncodedBuffer- Parameters:
bytes- array of bytes
-
clear
public void clear()Description copied from interface:EncodedBufferClear buffer of data- Specified by:
clearin interfaceEncodedBuffer
-
remaining
public int remaining()Description copied from interface:EncodedBufferGet size of remaining buffer data- Specified by:
remainingin interfaceEncodedBuffer- Returns:
- byte count of remaining data
-
rewind
public void rewind()Description copied from interface:EncodedBufferRewind buffer to start- Specified by:
rewindin interfaceEncodedBuffer
-
flip
public void flip()Description copied from interface:EncodedBufferFlip buffer to prepare for read or write operation- Specified by:
flipin interfaceEncodedBuffer
-
getBool
public boolean getBool()Description copied from interface:EncodedBufferRetrieve the next buffer entry as a boolean- Specified by:
getBoolin interfaceEncodedBuffer- Returns:
- boolean value
-
getByte
public byte getByte()Description copied from interface:EncodedBufferRetrieve the next buffer entry as a byte- Specified by:
getBytein interfaceEncodedBuffer- Returns:
- byte value
-
getByteRaw
public byte getByteRaw()Description copied from interface:EncodedBufferRetrieve the next buffer entry as a raw byte, even in a text buffer- Specified by:
getByteRawin interfaceEncodedBuffer- Returns:
- byte value
-
getChar
public char getChar()Description copied from interface:EncodedBufferRetrieve the next buffer entry as a char- Specified by:
getCharin interfaceEncodedBuffer- Returns:
- char value
-
getDouble
public double getDouble()Description copied from interface:EncodedBufferRetrieve the next buffer entry as a double- Specified by:
getDoublein interfaceEncodedBuffer- Returns:
- double value
-
getFloat
public float getFloat()Description copied from interface:EncodedBufferRetrieve the next buffer entry as a float- Specified by:
getFloatin interfaceEncodedBuffer- Returns:
- float value
-
getInt
public int getInt()Description copied from interface:EncodedBufferRetrieve the next buffer entry as an integer- Specified by:
getIntin interfaceEncodedBuffer- Returns:
- int value
-
getIPAddress
Description copied from interface:EncodedBufferRetrieve the next buffer entry as a IPAddress- Specified by:
getIPAddressin interfaceEncodedBuffer- Returns:
- IPAddress value
-
getIPV6Address
Description copied from interface:EncodedBufferRetrieve the next buffer entry as a IPV6Address- Specified by:
getIPV6Addressin interfaceEncodedBuffer- Returns:
- IPV6Address value
-
getLong
public long getLong()Description copied from interface:EncodedBufferRetrieve the next buffer entry as a long- Specified by:
getLongin interfaceEncodedBuffer- Returns:
- long value
-
getMACAddress
Description copied from interface:EncodedBufferRetrieve the next buffer entry as a MACAddress- Specified by:
getMACAddressin interfaceEncodedBuffer- Returns:
- MACAddress value
-
getShort
public short getShort()Description copied from interface:EncodedBufferRetrieve the next buffer entry as a short- Specified by:
getShortin interfaceEncodedBuffer- Returns:
- short value
-
getString
Description copied from interface:EncodedBufferRetrieve the next buffer entry as a String- Specified by:
getStringin interfaceEncodedBuffer- Returns:
- String value
-
peekString
Description copied from interface:EncodedBufferLooks at the next buffer without advancing- Specified by:
peekStringin interfaceEncodedBuffer- Returns:
- String value
-
getUUID
Description copied from interface:EncodedBufferRetrieve the next buffer entry as a UUID- Specified by:
getUUIDin interfaceEncodedBuffer- Returns:
- UUID value
-
putBool
Description copied from interface:EncodedBufferStore a boolean value to the encoded buffer- Specified by:
putBoolin interfaceEncodedBuffer- Parameters:
b- boolean value- Returns:
- EncodedBuffer object
-
putByte
Description copied from interface:EncodedBufferStore a byte value to the encoded buffer- Specified by:
putBytein interfaceEncodedBuffer- Parameters:
b- byte value- Returns:
- EncodedBuffer object
-
putByteList
Description copied from interface:EncodedBufferStore a byte list value to the encoded buffer- Specified by:
putByteListin interfaceEncodedBuffer- Parameters:
byteList- byte list value- Returns:
- EncodedBuffer object
-
putChar
Description copied from interface:EncodedBufferStore a char value to the encoded buffer- Specified by:
putCharin interfaceEncodedBuffer- Parameters:
c- char value- Returns:
- EncodedBuffer object
-
putDouble
Description copied from interface:EncodedBufferStore a double value to the encoded buffer- Specified by:
putDoublein interfaceEncodedBuffer- Parameters:
d- double value- Returns:
- EncodedBuffer object
-
putFloat
Description copied from interface:EncodedBufferStore a float value to the encoded buffer- Specified by:
putFloatin interfaceEncodedBuffer- Parameters:
f- float value- Returns:
- EncodedBuffer object
-
putInt
Description copied from interface:EncodedBufferStore an int value to the encoded buffer- Specified by:
putIntin interfaceEncodedBuffer- Parameters:
i- int value- Returns:
- EncodedBuffer object
-
putIPAddress
Description copied from interface:EncodedBufferStore an IPAddress value to the encoded buffer- Specified by:
putIPAddressin interfaceEncodedBuffer- Parameters:
i- IPAddress value- Returns:
- EncodedBuffer object
-
putIPV6Address
Description copied from interface:EncodedBufferStore an IPV6Address value to the encoded buffer- Specified by:
putIPV6Addressin interfaceEncodedBuffer- Parameters:
i- IPV6Address value- Returns:
- EncodedBuffer object
-
putLong
Description copied from interface:EncodedBufferStore a long value to the encoded buffer- Specified by:
putLongin interfaceEncodedBuffer- Parameters:
l- long value- Returns:
- EncodedBuffer object
-
putMACAddress
Description copied from interface:EncodedBufferStore a MACAddress value to the encoded buffer- Specified by:
putMACAddressin interfaceEncodedBuffer- Parameters:
m- MACAddress value- Returns:
- EncodedBuffer object
-
putShort
Description copied from interface:EncodedBufferStore a short value to the encoded buffer- Specified by:
putShortin interfaceEncodedBuffer- Parameters:
s- short value- Returns:
- EncodedBuffer object
-
putString
Description copied from interface:EncodedBufferStore a String value to the encoded buffer- Specified by:
putStringin interfaceEncodedBuffer- Parameters:
s- String value- Returns:
- EncodedBuffer object
-
putStringAsBytes
Description copied from interface:EncodedBufferStore a String value to the encoded buffer as a byte array- Specified by:
putStringAsBytesin interfaceEncodedBuffer- Parameters:
bytes- byte array value- Returns:
- EncodedBuffer object
-
putUUID
Description copied from interface:EncodedBufferStore a UUID value to the encoded buffer- Specified by:
putUUIDin interfaceEncodedBuffer- Parameters:
u- UUID value- Returns:
- EncodedBuffer object
-
nextString
-
peekNextString
-
asBool
-
asByte
-
asChar
-
asDouble
-
asFloat
-
asInt
-
asIPAddress
-
asIPV6Address
-
asLong
-
asMACAddress
-
asShort
-
asUUID
-
asString
-
asString
-
asString
-
asString
-
asString
-
asString
-
asString
-
asString
-
asString
-
asString
-
asString
-
asString
-
asString
-